package com.ruoyi.workflow.dubbo;

import com.ruoyi.workflow.api.RemoteActBusinessStatusService;
import com.ruoyi.workflow.api.domain.ActBusinessStatus;
import com.ruoyi.workflow.service.IActBusinessStatusService;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务状态
 *
 * @author gssong
 */
@RequiredArgsConstructor
@Service
@DubboService
public class RemoteActBusinessStatusServiceImpl implements RemoteActBusinessStatusService {

    private final IActBusinessStatusService iActBusinessStatusService;

    /**
     * @description: 根据业务id查询流程实例
     * @param: businessKey
     * @return: com.ruoyi.workflow.api.domain.ActBusinessStatus
     * @author: gssong
     * @date: 2022/12/10 13:43
     */
    @Override
    public ActBusinessStatus getInfoByBusinessKey(String businessKey) {
        return iActBusinessStatusService.getInfoByBusinessKey(businessKey);
    }

    /**
     * @description: 根据业务id集合查询流程实例
     * @param: businessKeys
     * @return: java.util.List<com.ruoyi.workflow.api.domain.ActBusinessStatus>
     * @author: gssong
     * @date: 2022/12/10 13:44
     */
    @Override
    public List<ActBusinessStatus> getListInfoByBusinessKey(List<String> businessKeys) {
        return iActBusinessStatusService.getListInfoByBusinessKey(businessKeys);
    }

    /**
     * @description: 按照业务id删除业务状态
     * @param: businessKey
     * @return: boolean
     * @author: gssong
     * @date: 2022/12/11 19:33
     */
    @Override
    public boolean deleteStateByBusinessKey(String businessKey) {
        return iActBusinessStatusService.deleteStateByBusinessKey(businessKey);
    }

    /**
     * @description: 按照业务流程实例id删除业务状态
     * @param: processInstanceId
     * @return: boolean
     * @author: gssong
     * @date: 2022/12/11 19:33
     */
    @Override
    public boolean deleteStateByProcessInstId(String processInstanceId) {
        return iActBusinessStatusService.deleteStateByProcessInstId(processInstanceId);
    }

    /**
     * @description: 根据流程实例id查询流程实例
     * @param: processInstanceId
     * @return: com.ruoyi.workflow.api.domain.ActBusinessStatus
     * @author: gssong
     * @date: 2022/12/11 19:34
     */
    @Override
    public ActBusinessStatus getInfoByProcessInstId(String processInstanceId) {
        return iActBusinessStatusService.getInfoByProcessInstId(processInstanceId);
    }

    /**
     * @description: 根据流程实例id集合查询流程实例
     * @param: processInstanceIds
     * @return: java.util.List<com.ruoyi.workflow.api.domain.ActBusinessStatus>
     * @author: gssong
     * @date: 2022/12/11 19:34
     */
    @Override
    public List<ActBusinessStatus> getInfoByProcessInstIds(List<String> processInstanceIds) {
        return iActBusinessStatusService.getInfoByProcessInstIds(processInstanceIds);
    }
}
